package com.juc.forkJoinPool.forkJoinPool4;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.ForkJoinTask;

public class Run {

	// public <T> ForkJoinTask<T> submit(ForkJoinTask<T> task) 使用
	public static void main(String[] args) throws InterruptedException, ExecutionException {
		MyRecursiveTask task = new MyRecursiveTask();
		ForkJoinPool pool = new ForkJoinPool();
		ForkJoinTask<String> returenTask = pool.submit(task);
		System.out.println("begin " + System.currentTimeMillis());
		System.out.println(returenTask.get());
		System.out.println("end " + System.currentTimeMillis());
	}
}
